package main;

import java.text.DecimalFormat;

public class TwoDGrid implements IGrid {
	
	public static final int SIDE_TOP = 0;
  public static final int SIDE_BOTTOM = 1;
  public static final int SIDE_LEFT = 2;
  public static final int SIDE_RIGHT = 3;
  
  public static final int CALC_FLOAT = 0;
  public static final int CALC_DOUBLE = 1;
  public static final int CALC_FLOATOBJ = 2;
  public static final int CALC_LINKEDBOUBLE = 3;
	
  protected DecimalFormat decimalText = new DecimalFormat("0.00");
  
	/**
	 * Gets the size in X of the grid (top-bottom)
	 * @return int
	 */
	public int getGridSizeX() {
		return gridSizeX;
	}
	
	/**
	 * Gets the size in Y of the grid (left-right)
	 * @return int
	 */
	public int getGridSizeY() {
		return gridSizeY;
	}
	
	
	/* Implemented methods. They do nothing */
	public Double getDoubleObjValue(ICoordinate coord) {
		return null;
	}

	public double getDoubleValue(ICoordinate coord) {
		return 0;
	}

	public Float getFloatObjValue(ICoordinate coord) {
		return null;
	}

	public float getFloatValue(ICoordinate coord) {
		return 0;
	}

	public ICoordinate getNeighbor(ICoordinate coord, int direction) {
		return null;
	}

	public boolean isDone() {
		return false;
	}

	public String printCell(ICoordinate coord) {
		return null;
	}

	public void setDoubleObjValue(ICoordinate coord, Double value) {
		
	}

	public void setDoubleValue(ICoordinate coord, double value) {
		
	}

	public void setFloatObjValue(ICoordinate coord, Float value) {
		
	}

	public void setFloatValue(ICoordinate coord, float value) {
		
	}

	public void stepGrid() {
		
	}
  
  public static void printResults(int dimension, TwoDGrid myGrid) {
    for(int y=1; y <= dimension-1; y++) {
      System.out.print("["+y+"]");
      for(int x=1; x <= dimension-1; x++) {
        System.out.print(myGrid.printCell(new XYCoordinate(x, y)));
        System.out.print( (x+1) == dimension ? "" : ", ");
      }
      System.out.println();
    }
  }

	/* Private */
	protected int gridSizeX, gridSizeY;
}